Skip to content

feat: implement aggregation methods with support for grouping and med…#577

Open
kulikp1 wants to merge 6 commits intonextfrom
feature/AdminForth/1453/resource(x).aggregate
Open

feat: implement aggregation methods with support for grouping and med…#577
kulikp1 wants to merge 6 commits intonextfrom
feature/AdminForth/1453/resource(x).aggregate

Conversation

@kulikp1
Copy link
Copy Markdown
Collaborator

@kulikp1 kulikp1 commented Apr 24, 2026

…ian calculations in Clickhouse, MongoDB, and MySQL connectors

…ian calculations in Clickhouse, MongoDB, and MySQL connectors
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds getAggregateWithOriginalTypes support to additional data connectors so resource().aggregate() can run server-side aggregations (sum/count/avg/min/max/median) with optional grouping by field or date truncation.

Changes:

  • Implemented aggregation query building + grouping for MySQL, MongoDB, and ClickHouse connectors.
  • Added connector-specific median implementations (ClickHouse quantile-based; MySQL/Mongo compute median in application code).
  • Updated ClickHouse connector typing for getDataWithOriginalTypes return type.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
adminforth/dataConnectors/mysql.ts Adds aggregate query generation with grouping and a JS-computed median fed by GROUP_CONCAT.
adminforth/dataConnectors/mongo.ts Adds MongoDB aggregation pipeline for group + aggregates, including JS-side median from $pushed values.
adminforth/dataConnectors/clickhouse.ts Adds ClickHouse aggregate query generation with grouping and median via quantile(0.5).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread adminforth/dataConnectors/clickhouse.ts
Comment thread adminforth/dataConnectors/mysql.ts Outdated
Comment thread adminforth/dataConnectors/mysql.ts Outdated
Comment thread adminforth/dataConnectors/mongo.ts Outdated
Comment thread adminforth/dataConnectors/mongo.ts
Comment thread adminforth/dataConnectors/clickhouse.ts
…ian calculations in Clickhouse, MongoDB, and MySQL connectors
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread adminforth/dataConnectors/clickhouse.ts
Comment thread adminforth/dataConnectors/clickhouse.ts
Comment thread adminforth/dataConnectors/mysql.ts Outdated
Comment thread adminforth/dataConnectors/mysql.ts Outdated
Comment thread adminforth/dataConnectors/mongo.ts Outdated
Comment thread adminforth/dataConnectors/mongo.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants